
import request from '@/utils/request'

export function getTemplateData(query) {
    return request({
        url: '/lims/table/data',
        method: 'get',
        params: query
    })
}

export function getTableDataByTask(myId) {
    return request({
        url: '/lims/myTask/myTaskFormList/' + myId,
        method: 'get',
    })
}

export function myTaskFormListByTaskId(taskId) {
    return request({
        url: `/lims/myTask/myTaskFormListByTaskId/${taskId}`,
        method: 'get',
    })
}

export function getTemplateContent(tableId) {
    return request({
        url: '/lims/table/data/content/' + tableId,
        method: 'get',
    })
}


export function userRecordList(myId) {
    return request({
        url: '/lims/myTask/userRecordList/' + myId,
        method: 'get',
    })
}

export function addTableData(data) {
    return request({
        url: '/lims/table/data',
        method: 'post',
        data: data
    })
}

export function approveData(data) {
    return request({
        url: '/lims/myTask/approve',
        method: 'post',
        data: data
    })
}

export function returnWriteData(data) {
    return request({
        url: '/lims/myTask/returnWrite',
        method: 'post',
        data: data
    })
}

export function reloadTable(taskId) {
    return request({
        url: '/lims/table/data/reloadTable/' + taskId,
        method: 'put',
    })
}

export function reloadArchiveFile(myId) {
    return request({
        url: '/lims/myTask/reloadArchive/' + myId,
        method: 'get',
    })
}

// 获取手动用户树形结构
export function getTree() {
    return request({
        url: '/lims/myTask/userList',
        method: 'get',
    })
}

// 更新相关表的签字
export function updateFormSign(data) {
    return request({
        url: '/lims/myTask/updateFormSign',
        method: 'post',
        data: data
    })
}

// 更改任务表单数据
export function updateTaskForm(data) {
    return request({
        url: '/lims/myTask/updateTaskForm',
        method: 'post',
        data: data
    })
}
